//package com.cssy.yd.logic.web;
//
//
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
//import org.springframework.stereotype.Controller;
//import org.springframework.ui.Model;
//import org.springframework.web.bind.annotation.RequestMapping;
//
//import com.cssy.yd.basic.service.IBasicMaterialsService;
//import com.cssy.yd.logic.service.ILogicWhAffStockService;
//import com.plat.helper.JqGridHandler;
//import com.plat.helper.SearchCondition;
//import com.plat.helper.SearchConditions;
//import com.plat.helper.SearchResult;
//import com.plat.util.json.OutJsonGrid;
//
//
//@Controller
//@RequestMapping("/public/windowalert")
//public class WindowAlertController  {
//	private static final String ITEM = "/public/ItemManager";// 选择物料
//	private static final String AFFITEM = "/public/ItemAffList";// 选择物料
//	private static final String BATCHITEM = "/public/ItemBatchList";// 选择批次
//	@Resource(name="basicMaterialsService")
//	private IBasicMaterialsService basicMaterialsService;
//	
//	@Resource(name = "logicWhAffStockService")
//	private ILogicWhAffStockService logicWhAffStockService;
//	/**
//	 * 查找物料
//	 * @param request
//	 * @param model
//	 * @return
//	 * @throws Exception
//	 */
//	@RequestMapping(value = "/itemmanager")
//	public String itemmanager(HttpServletRequest request, Model model)
//			throws Exception {
//		return ITEM;
//	}
//
//	@RequestMapping(value = "/itemlist")
//	public void ltemlist(HttpServletRequest request, HttpServletResponse response)
//			throws Exception {
//		JqGridHandler hander = new JqGridHandler(request);
//		SearchConditions scs = new SearchConditions();
//		hander.getWheres(scs);
//		if(scs.getOrderBy()==null||"".equals(scs.getOrderBy()))
//			 scs.setOrderBy("code");
//		SearchResult result = basicMaterialsService.findListByUnitExample(scs);
//		OutJsonGrid out = new OutJsonGrid(result);
//		out.printJSon(response);
//	}
//	
//	/**
//	 * 查找物料
//	 * @param request
//	 * @param model
//	 * @return
//	 * @throws Exception
//	 */
//	@RequestMapping(value = "/itemaff")
//	public String itemaff(HttpServletRequest request, Model model)
//			throws Exception {
//		String code = request.getParameter("code");
//		model.addAttribute("code", code);
//		return AFFITEM;
//	}
//
//	@RequestMapping(value = "/itemafflist")
//	public void itemafflist(HttpServletRequest request, HttpServletResponse response)
//			throws Exception {
//		String code = request.getParameter("code");
//		JqGridHandler hander = new JqGridHandler(request);
//		SearchConditions scs = new SearchConditions();
//		hander.getWheres(scs);
//		scs.addCondition("whcode", code, SearchCondition.OP_EQUAL);
//		SearchResult result = logicWhAffStockService.findForWareHouseStockByExample(scs);
//		OutJsonGrid out = new OutJsonGrid(result);
//		out.printJSon(response);
//	}
//	
//	/**
//	 * 查找物料
//	 * @param request
//	 * @param model
//	 * @return
//	 * @throws Exception
//	 */
//	@RequestMapping(value = "/itembatch")
//	public String itembatch(HttpServletRequest request, Model model)
//			throws Exception {
//		String maCode = request.getParameter("maCode");
//		String whCode = request.getParameter("whCode");
//		String hubCode = request.getParameter("hubCode");
//		model.addAttribute("maCode", maCode);
//		model.addAttribute("whCode", whCode);
//		model.addAttribute("hubCode", hubCode);
//		return BATCHITEM;
//	}
//
//	@RequestMapping(value = "/itembatchlist")
//	public void itembatchlist(HttpServletRequest request, HttpServletResponse response)
//			throws Exception {
//		String maCode = request.getParameter("maCode");
//		String whCode = request.getParameter("whCode");
//		String hubCode = request.getParameter("hubCode");
//		Map<String, String> map=new HashMap<String, String>();
//		if(maCode!=null&&!"".equals(maCode)){
//			map.put("code", maCode);
//		}
//		if(whCode!=null&&!"".equals(whCode)){
//			map.put("whcode", whCode);
//		}
//		if(hubCode!=null&&!"".equals(hubCode)){
//			map.put("hubcode", hubCode);
//		}
//		SearchResult rs=new SearchResult();
//		List<String> list=logicWhAffStockService.findbatch(map);
//		rs.setRecordCount(list.size());
//		rs.setResults(list);
//		OutJsonGrid out = new OutJsonGrid(rs);
//		out.printJSon(response);
//	}
//}
